package com.example.twotwo_project;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

@SuppressLint("ValidFragment")
public class Serach_Frg001 extends Fragment {
	Context mContext;
	private EditText et;
	private Button bt;
	private Button bt2;
	private String info;

	public Serach_Frg001(Context context) {
		mContext = context;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		
		View view = inflater.inflate(R.layout.activity_serach_main, null);
	   
		et=(EditText)view.findViewById(R.id.edit_text); // 검색어 입력란
	    bt2=(Button)view.findViewById(R.id.button1); // 지역검색버튼
	    
	    
	    bt2.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				info=et.getText().toString();
						
				
				// 다시 보기 getActivity() 부문 오류 발생가능
				Intent intent = new Intent(getActivity(), NaverLocal.class);
				
				Bundle data = new Bundle();
				data.putString("key", info);
				intent.putExtras(data);
				startActivity(intent);
				
			}
		});
	    
		
		return view;
	}
	
	
	
}
